scatter_df |>
mutate(
text_label = paste(
"Date:", date,
"Tmin:", round(tmin_c, 1), "C",
"Tmax:", round(tmax_c, 1), "C"
)) |>
plot_ly(
x = ~tmin_c, y = ~tmax_c,
type = "scatter", mode = "markers",
color = ~tmax_c,
text = ~text_label, hoverinfo = "text",
opacity = 0.7, marker = list(size = 3)
) |>
layout(
xaxis = list(title = "Tmin (C)"),
yaxis = list(title = "Tmax (C)"),
title = "Daily Tmin vs Tmax (20,000 sampled)"
)
box_df |>
plot_ly(
y = ~snow, color = ~month,
type = "box"
) |>
layout(
xaxis = list(title = ""),
yaxis = list(title = "Snowfall (mm)"),
title = "Snowfall distribution by month"
)
bar_df |>
plot_ly(
x = ~month, y = ~n_days,
type = "bar", color = ~month,
text = ~paste(n_days, "days"), hoverinfo = "text+x+y"
) |>
layout(
xaxis = list(title = ""),
yaxis = list(title = "Days with precitipation (> 0 mm)"),
title = "Precipitation days by month"
)